From: Chong Yidong Date: Mon, 6 Aug 2007 17:25:30 +0000 (+0000) Subject: (redisplay_window): When restoring original buffer position, make sure X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~17494 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=ef6b947f72cd4fc1408a7dbd85ed3b70816c8396;p=emacs.git (redisplay_window): When restoring original buffer position, make sure it is still valid. --- diff --git a/src/xdisp.c b/src/xdisp.c index 14a55720877..a565c43223d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13520,7 +13520,10 @@ redisplay_window (window, just_this_one_p) /* Restore current_buffer and value of point in it. */ TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint)); set_buffer_internal_1 (old); - TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); + /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become + shorter. This can be caused by log truncation in *Messages*. */ + if (CHARPOS (lpoint) <= ZV) + TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); unbind_to (count, Qnil); }